﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Net;
using System.Text;

public partial class Busca : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["query"] != null)
        {
            string query = Request.QueryString["query"];

            query = query.Replace(' ', '/');

            WebClient client = new WebClient();
            Stream stream = client.OpenRead("http://gdata.youtube.com/feeds/api/videos/-/" + query);
            StreamReader reader = new StreamReader(stream);
            string retorno = reader.ReadToEnd();
            Response.Write(retorno);
        }
    }
}